#ifndef _ARKHANDLE_WORKER_H__
#define _ARKHANDLE_WORKER_H__
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/limits.h>
#include "ArkMinnerConf.h"
#include "ArkTcpServer.h"
#include "jemalloc/jemalloc.h"

namespace kd
{
	class ArkKcxpWorker
	{
	public:
		ArkKcxpWorker();
		~ArkKcxpWorker();
		static ArkKcxpWorker* ins();

		bool DealWithPacket(ArkClient_t& client, std::string& result);

		bool DealWithPacket(ArkClient_t& client, char* data, int32_t len);

	private:
		ArkSpinMutex thd_locker;
		std::unordered_map <int, std::string> fdid_map;

		ArkThreadPool<std::function<void()>> thprod_pool;
		ArkThreadPool<std::function<void()>> thpcon_pool;
	};
}
#endif